<!--
*Author：jxx
 *Contact：283591387@qq.com
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *业务请在@/extension/salesinfo/delivery_request/q_delivery_request.js此处编写
 -->
<template>
    <view-grid ref="grid"
               :columns="columns"
               :detail="detail"
               :editFormFields="editFormFields"
               :editFormOptions="editFormOptions"
               :searchFormFields="searchFormFields"
               :searchFormOptions="searchFormOptions"
               :table="table"
               :extend="extend">
    </view-grid>
</template>
<script>
    import extend from "@/extension/salesinfo/delivery_request/q_delivery_request.js";
    import { ref, defineComponent } from "vue";
    export default defineComponent({
        setup() {
            const table = ref({
                key: 'Delivery_request',
                footer: "Foots",
                cnName: '发货申请单',
                name: 'delivery_request/q_delivery_request',
                url: "/q_delivery_request/",
                sortName: "Voucher_sub"
            });
            const editFormFields = ref({"Voucher_sub":"","Sales_contract_sub":"","deliveryTime":"","Client":"","Project_name":"","Delivery_address":"","Remark":"","Attachment":"","Image":"","Sales_contract":""});
            const editFormOptions = ref([[{"title":"单据编码","field":"Voucher_sub","type":"text"},
                               {"title":"销售合同","field":"Sales_contract_sub","type":"text"},
                               {"title":"发货时间","field":"deliveryTime","type":"date"}],
                              [{"dataKey":"无条件客户","data":[],"title":"客户","field":"Client","type":"select"},
                               {"title":"项目名称","field":"Project_name"},
                               {"title":"交付地址","field":"Delivery_address"}],
                              [{"title":"备注","field":"Remark","colSize":12,"type":"textarea"}],
                              [{"title":"附件","field":"Attachment","type":"file"},
                               {"title":"图片","field":"Image","type":"img"}],
                              [{"title":"销售合同ID","field":"Sales_contract","type":"text"}]]);
            const searchFormFields = ref({"Voucher_sub":"","Sales_contract_sub":"","Client":"","Goods_num":[null,null],"AuditStatus":"","AuditDate":"","CreateDate":"","deliveryTime":"","Project_name":""});
            const searchFormOptions = ref([[{"title":"单据编码","field":"Voucher_sub","type":"like"},{"title":"销售合同","field":"Sales_contract_sub"},{"title":"数量","field":"Goods_num","type":"range"}],[{"dataKey":"audit","data":[],"title":"审核状态","field":"AuditStatus","type":"select"},{"title":"审核时间","field":"AuditDate","type":"datetime"},{"title":"创建时间","field":"CreateDate","type":"datetime"}],[{"title":"发货时间","field":"deliveryTime","type":"date"},{"title":"项目名称","field":"Project_name"},{"dataKey":"无条件客户","data":[],"title":"客户","field":"Client","type":"select"}]]);
            const columns = ref([{field:'Voucher_sub',title:'单据编码',type:'string',link:true,width:180,align:'left',sort:true},
                       {field:'Sales_contract_sub',title:'销售合同',type:'string',width:110,align:'left'},
                       {field:'Client',title:'客户',type:'int',bind:{ key:'无条件客户',data:[]},width:120,align:'left'},
                       {field:'Goods_num',title:'数量',type:'float',width:110,hidden:true,align:'left'},
                       {field:'Total_price',title:'金额',type:'decimal',width:110,hidden:true,align:'left'},
                       {field:'Project_name',title:'项目名称',type:'string',width:220,align:'left'},
                       {field:'AuditStatus',title:'审核状态',type:'int',bind:{ key:'audit',data:[]},width:110,align:'left'},
                       {field:'Attachment',title:'附件',type:'file',width:110,align:'left'},
                       {field:'Image',title:'图片',type:'img',width:110,align:'left'},
                       {field:'Remark',title:'备注',type:'string',width:220,align:'left'},
                       {field:'AuditDate',title:'审核时间',type:'datetime',width:150,align:'left',sort:true},
                       {field:'AuditID',title:'审核人员id',type:'int',width:110,hidden:true,align:'left'},
                       {field:'Auditor',title:'审核人员',type:'string',width:120,hidden:true,align:'left'},
                       {field:'CreateID',title:'创建人员id',type:'int',width:100,hidden:true,align:'left'},
                       {field:'Creator',title:'创建人员',type:'string',width:100,hidden:true,align:'left'},
                       {field:'CreateDate',title:'创建时间',type:'datetime',width:150,align:'left',sort:true},
                       {field:'ModifyID',title:'修改人员id',type:'int',width:100,hidden:true,align:'left'},
                       {field:'Modifier',title:'修改人员',type:'string',width:100,hidden:true,align:'left'},
                       {field:'ModifyDate',title:'修改时间',type:'datetime',width:150,hidden:true,align:'left',sort:true},
                       {field:'Delivery_request',title:'ID',type:'guid',width:110,hidden:true,require:true,align:'left'},
                       {field:'Sales_contract',title:'销售合同ID',type:'guid',width:110,hidden:true,align:'left'},
                       {field:'deliveryTime',title:'发货时间',type:'date',width:150,align:'left',sort:true},
                       {field:'Delivery_address',title:'交付地址',type:'string',width:110,align:'left'}]);
            const detail = ref({
                cnName: "#detailCnName",
                table: "#detailTable",
                columns: [],
                sortName: "",
                key: ""
            });
            return {
                table,
                extend,
                editFormFields,
                editFormOptions,
                searchFormFields,
                searchFormOptions,
                columns,
                detail,
            };
        },
    });
</script>
